// testing the xmlHttpRequest object
function xmlHttpTest(){
	try{
		function handler() {
			if(this.readyState == 4 && this.status == 200) {
				// so far so good
				if(this.responseXML != null)
					alert(this.responseXML.getElementsByTagName("test"));
				else
					throw new AssertError("XmlHttpRequest couldn't load data");
			}
			else if (this.readyState == 4 && this.status != 200) {
				// fetched the wrong page or network error...
				throw new AssertError("network error when trying to execute XmlHttpRequest");
			}
		}

		var client = new XMLHttpRequest();
		client.onreadystatechange = handler;
		client.open("GET", "test.xml");
		client.send();
	} catch(e) {
		alert(e.name + ": " + e.message);
	}
}